﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<HomeViewModel>" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <%= HtmlMetaHelper.HtmlTitle("深圳恒乐科技有限公司") %>
    <link href="<%=Url.Content("~/css/Website/Common.css") %>" rel="stylesheet" type="text/css" />
    <link href="<%=Url.Content("~/css/Website/Index.css") %>" rel="stylesheet" type="text/css" />
    <link href="<%=Url.Content("~/css/Website/menu.css") %>" rel="stylesheet" type="text/css" />
    <style type="text/css">
        #menu
        {
            padding-top: 15px;
            margin-left: 0;
        }
    </style>
    <script src="<%=Url.Content("~/Scripts/Common/jquery-1.3.2.min.js") %>" type="text/javascript"></script>
    <script src="<%=Url.Content("~/Scripts/Common/jquery.marquee.js") %>" type="text/javascript"></script>
    <!--[if IE 6]>
    <script src="<%=Url.Content("~/Scripts/Common/DD_belatedPNG_0.0.8a-min.js") %>" type="text/javascript"></script>
    <script type="text/javascript" src="<%=Url.Content("~/Scripts/Common/Ie6Png.js") %>"></script>
    <script type="text/javascript">
        DD_belatedPNG.fix(".childMenu .acr, .childMenu .acl, .childMenu .acm,.index_main .desc,.backHome");
        DD_belatedPNG.fix(".front a, .next a,div.d a.front,div.d a.next");
    </script>
    <![endif]-->
    <script type="text/javascript">
        $(function () {
            var postiont = $(".index_main .menu").offset();
            $("#menu").css({ left: postiont.left + 30, top: postiont.top + 20 });
            $("#menu li.parent").hover(function () { $(this).find(".childMenu").show(); }, function () { $(this).find(".childMenu").hide(); });
            $(document.body).click(function () { $("#menu .childMenu").hide(); });
            var commendList = $(".commend li");
            var commendTimer; var commendCount = 0; var isRun = true;
            var commendToggle = function (i) {
                clearTimeout(commendTimer);
                commendCount = i;
                if (commendCount < 0)
                    commendCount = commendList.length - 1;
                if (commendCount >= commendList.length)
                    commendCount = 0;
                commendList.hide();
                commendList.eq(commendCount).fadeIn(1000);
                commendTimer = setTimeout(function () { commendToggle(commendCount + 1); }, 5000);
            };
            commendList.parent().hover(function () { clearTimeout(commendTimer); /*isRun = false; */ }, function () { /*isRun = true; */commendTimer = setTimeout(function () { commendToggle(commendCount); }, 3000); });
            commendList.find("a.next").click(function () { /*clearTimeout(commendTimer); */commendToggle(commendCount + 1); });
            commendList.find("a.front").click(function () { /* clearTimeout(commendTimer); */commendToggle(commendCount - 1); });
            commendToggle(commendCount);
            $.getJSON('<%=Url.Action("Slide","Advertise",new {aid=3}) %>', { rnd: Math.random() }, function (data) {
                var box = $("<ul></ul>");
                $.each(data, function (i, n) { box.append("<a href=\"" + n.Redirect + "\"><img src=\"" + n.ImageName + "\" alt='' /></a>"); });
                $("#marquee").append(box).kxbdMarquee({ direction: 'right' });
            });
            $.getJSON('<%=Url.Action("Slide","Advertise",new {aid=4}) %>', { rnd: Math.random() }, function (data) {
                var box = $(".index_news dl")
                $.each(data, function (i, n) { box.append("<dd><a href=\"" + n.Redirect + "\">" + n.Title + "</a></dd>"); });
            });
            $.getJSON('<%=Url.Action("Slide","Advertise",new {aid=2}) %>', { rnd: Math.random() }, function (data) {
                var imageArry = [];
                $.each(data, function (i, n) {
                    imageArry[i] = $("<img alt='' src=\"" + n.ImageName + "\" />");
                    var n = $(imageArry[i]); n.css({ width: /* n.outerWidth() || n.css("width")*/501, height: /*n.outerHeight() || n.css("height")*/391, filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod='scale',src='" + n.attr("src") + "')" }).attr("src", "http://ie7-js.googlecode.com/svn/version/2.1(beta4)/blank.gif");

                });
                function ssss(index) {
                    if (index >= data.length) index = 0;
                    $("#visual").html(imageArry[index]);
                    setTimeout(function () { ssss(index + 1) }, 5000);
                }
                ssss(0);
            });
        });
    </script>
</head>
<body>
    <div class="index_top">
        <a class="logo" href="<%=Url.Action("Index","Home") %>">
            <img src="<%=Url.Content("~/Images/logo2.gif")%>" alt="" /></a>
        <div class="language">
            <%= Html.ActionLink("中文版","Index","Home")%>
            |
            <%= Html.ActionLink("English Version", "Index", "Home", new { language="en" },null)%>
        </div>
    </div>
    <div class="index_main">
        <div class="menu">
            &nbsp;
        </div>
        <div class="commend">
            <ul>
                <%
                    foreach (ESlide item in Model.CommandList)
                    {
                %>
                <li><a target="_blank" href="<%= item.Redirect %>">
                    <img src="<%=item.ImageName %>" alt="" />
                </a>
                    <div class="d">
                        <a class="next" href="javascript:void(0)">&nbsp;&nbsp;</a><a class="front" href="javascript:void(0)">&nbsp;&nbsp;</a><span>
                            <%=item.Title%></span>
                    </div>
                </li>
                <%
                    }
                   
                %>
            </ul>
        </div>
        <div class="desc">
            <div class="c">
                <div id="visual">
                </div>
                <div style="position: absolute; top: 0; left: 0;">
                    <embed src="<%=Url.Content("~/Images/tqqa10.swf") %>" pluginspage="http://www.macromedia.com/go/getflashplayer"
                        width="520" height="400" type="application/x-shockwave-flash" quality="high"
                        wmode="transparent"></embed>
                </div>
            </div>
        </div>
    </div>
    <div class="index_news">
        <dl>
            <dt>新品促销</dt>
        </dl>
        <div id="marquee">
        </div>
    </div>
    <ul id="menu">
        <%=Html.HengLeMenu(ViewData["HengLeMenu"] as List<EClassify>) %>
    </ul>
    <%--  
  <div style="position: absolute; background-color: transparent; top: 0; left: 0; width: 99.5%;
        height: 100%; margin: 0 auto;">
        <embed src="<%=Url.Content("~/Images/tqqa18.swf") %>" pluginspage="http://www.macromedia.com/go/getflashplayer"
            width="100%" height="100%" type="application/x-shockwave-flash" quality="high"
            wmode="transparent" />
    </div>
    --%>
</body>
</html>
